Overview:
The pursuit of highly detailed models and meshes has always been a goal of computer graphics, but rendering these images is taxing on hardware. Detailed meshes are often too time consuming to render in real-time. Simplifying these meshes while retaining a sufficient level of detail is paramount for timely rendering. Mesh simplification using the quadratic error metric attempts to address this.
The algorithm attempts to progressively remove information from the mesh while retaining its geometry.
Each vertex computes a minimum error for collapsing one of its edges. It does this by creating a matrix based on its adjacent triangles. The vertex's matrix is combined with a connecting edge vertex's matrix to find the ideal position for an edge colapse. This position is compared against the original vertex to compute a cost for collapsing the edge and moving the vertex. These costs are held in a priority queue so that the edge with the least error will collapse first. I created a error threshold for which a vertex would not collapse its edge if its error was too high (it would disturb the topology more than desired). I also allowed for an incrementation of the error threshold for further simplification.
Bunny with 10,000 Triangles
Bunny with 6,477 Triangles (65% original size)
Bunny with 1,502 Triangles (15% original size)
Bunny with 694 Triangles (7% original size)
Bunny with 229 Triangles (2% original size)
Bunny with 173 Triangles (1.7% original size)
The mesh maintains its bunny shape all the way through to under 2% the original number of polygons.
Gargoyle with 2,000 Triangles
Gargoyle with 1,170 Triangles
Gargoyle with 608 Triangles
Gargoyle with 300 Triangles
The gargoyle does not begin to lose the topology of his wings until it is decimated to about 15% of its original size.
Conclusion:
Decimation of meshes using the quadratic error metric seems to be a very useful way of greatly reducing the data without losing too much detail in the model. For larger models like the 20,000 face bunny, the quadratic error metric can reduce the storage needs by 85 to 90 percent before a noticeable difference in model shape is obtained. This could allow developers to run real-time simulations or games with a much higher frame rate than with the original models.
Problems:
Because I used a triangle based data structure, I was not able to import square based meshes into my program. This prevented me from using files from 3ds Max which were square based meshes. In the future I may have to create a new data structure to handle these mesh types.
Provided Executable:
The provided executable is my program's attempt at simplifying a 2,000 triangle face gargoyle mesh. The number '4' is used to simplify the mesh. Press and hold to further simplify.
Executable
Resources:
Quadratic Error Metrics